A data flow, such as sensor data generated by a sensor source, ever-increasing log data, and a continuously updated securities trading record, is a common data form. Compared with a conventional database management system, data flow processing has two unique characteristics: (1) continuity, that is, data is continuously generated, and a corresponding data processing operation needs to be driven by data, to be continuously and repeatedly performed; (2) real-time performance, that is, a data processing delay needs to be short enough to meet specific delay requirements of various applications, and if data is not processed in a timely manner, input data may be blocked, and a processing result is further affected.
Considering a requirement of a data flow processing system on the real-time performance, a coprocessor or an accelerator is commonly used to accelerate processing of a data flow task, so as to improve system throughput. The accelerator may be a graphics processing unit (GPU), a field programmable gate array (FPGA), or the like.
Processing a data flow is executing a data flow task, and the data flow task may be divided into multiple subtasks. In a distributed heterogeneous system, each subtask may be separately executed by a central processing unit (CPU) and a GPU. However, resource configurations for all working nodes in the system may be different, and computing capabilities of the CPU and the GPU are also quite different. Therefore, the subtask needs to be appropriately scheduled to meet a delay requirement and maximize system throughput.
An existing method for scheduling a data flow task may be adjusted according to a change of the subtask to dynamically calculate overheads of executing the subtask separately by the CPU and the GPU, thereby selecting a platform with a less overhead to execute the subtask. However, in the method for scheduling a data flow task, overheads of executing each subtask by the CPU and the GPU need to be calculated, and consequently, a scheduling delay is relatively long.